﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Finance/FinanceMaster.master" AutoEventWireup="true" 
	CodeBehind="LetterTypeList.aspx.cs" Inherits="WebApplication.Finance.LetterTypeList" Theme="BaselineTheme" %>

<%@ Register src="../Controls/PageHeadingBarCtrl.ascx" tagname="PageHeadingBarCtrl" tagprefix="uc1" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajax" %>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
.chkBoxList
{
	text-align:left;
}
.addNewButton
{
	margin-top:6px;
	margin-right:52px;	
}
.editingPanel
{
	margin:auto; 
	margin-top:24px; 
	padding: 14px;
	width:260px;
}
.listPanel
{
	margin:auto; 
	width:810px;
}

</style>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">

<!-- Heading bar -->
<div style="margin:auto; margin-top:0px; width:810px;">
	<uc1:PageHeadingBarCtrl ID="pageHeadingBarCtrl" runat="server" Title="Letter Type" />
</div>

<!-- List -->
<asp:Panel runat="server" ID="pnlList" CssClass="listPanel">
	<asp:UpdatePanel ID="updatePanel1" runat="server" UpdateMode="Always">
	<ContentTemplate>
		<asp:GridView ID="gridLetterType" runat="server" AutoGenerateColumns="False" 
			ViewStateMode="Disabled" EnableViewState="false"
			HorizontalAlign="Center" DataKeyNames="LetterTypeId"			
			CellPadding="4" Font-Names="Verdana" BorderStyle="None" GridLines="None"
			onrowdatabound="gridLetterType_RowDataBound"
			onrowcommand="gridLetterType_RowCommand" >
			<Columns>
				<asp:BoundField DataField="Name" HeaderText="Name">
					<HeaderStyle HorizontalAlign="Left" />
					<ItemStyle HorizontalAlign="Left" Width="140px" />
				</asp:BoundField>
				<asp:BoundField DataField="DaysAsText" HeaderText="Days">
					<HeaderStyle HorizontalAlign="Left" />
					<ItemStyle HorizontalAlign="Left" Width="160px" />
				</asp:BoundField>
				<asp:BoundField DataField="TimeMinutesAsText" HeaderText="Hour">
					<HeaderStyle HorizontalAlign="Left" />
					<ItemStyle HorizontalAlign="Left" Width="60px" />
				</asp:BoundField>
				<asp:BoundField DataField="InUseAsText" HeaderText="In Use">
					<HeaderStyle HorizontalAlign="Center" />
					<ItemStyle HorizontalAlign="Center" Width="60px" />
				</asp:BoundField>
				<asp:BoundField DataField="ModifiedAsText" HeaderText="Modified" >
					<HeaderStyle HorizontalAlign="Left" />
					<ItemStyle HorizontalAlign="Left" Font-Size="10px" Width="100px" Wrap="true" />
				</asp:BoundField>
				<asp:ButtonField ButtonType="Button" Text="Select" CommandName="Select" />
				<asp:ButtonField ButtonType="Button" Text="Delete" CommandName="DeleteLetterType" />
			</Columns>		
			<HeaderStyle Font-Size="12pt" Font-Bold="True" Font-Names="Arial" HorizontalAlign="Left" />
			<RowStyle Font-Size="11pt" Font-Bold="False" Font-Names="Arial" HorizontalAlign="Left" CssClass="UnderlineBorder" />
			<EmptyDataTemplate>				
				<table>
					<tr>
						<td><span class="Instructions">Use the Add button to create a new letter type.</span></td>
					</tr>
				</table>
			</EmptyDataTemplate>
			<SelectedRowStyle BackColor="White" />
		</asp:GridView>
		<div style="width:810px; height:36px; text-align:right;"><asp:Button ID="butAddNew" runat="server" Text="Add" onclick="butAddNew_Click" CssClass="addNewButton" /></div>
	</ContentTemplate>
	</asp:UpdatePanel>
</asp:Panel>

<!-- Editing panel -->
<asp:Panel runat="server" ID="pnlEditing" CssClass="editingPanel">
	<table cellpadding="4" cellspacing="0" border="0" class="DataTable">
		<tr>
			<td style="width:50px;" class="DataTableLabelBold">Name:</td>
			<td style="width:200px;"><asp:TextBox runat="server" ID="txtNewName" Width="180px" MaxLength="50" /></td>
		</tr>
		<tr>
			<td valign="top" class="DataTableLabelBold" nowrap="nowrap">Timed Print:</td>
			<td><asp:CheckBox runat="server" ID="chkSpecificTime" AutoPostBack="true" /></td>
		</tr>
		<tr>
			<td valign="top" class="DataTableLabelBold">Days:</td>
			<td><asp:CheckBoxList runat="server" ID="chkNewDays" /></td>
		</tr>
		<tr>
			<td class="DataTableLabelBold">Hour:</td>
			<td><asp:DropDownList runat="server" ID="cboNewHour" /></td>
		</tr>
		<tr>
			<td></td>
			<td style="text-align:right"><asp:Button ID="butNewOK" runat="server" Text="OK" onclick="butNewOK_Click" />&nbsp;
			<asp:Button ID="butNewCancel" runat="server" Text="Cancel" onclick="butNewCancel_Click" />
			</td>
		</tr>
	</table>
</asp:Panel>

<!-- Buttons -->
<asp:Panel runat="server" ID="pnlButtons" CssClass="sectionPanel">
<table border="0" width="100%">
	<tr>
		<td><span style="padding-left:38px;" class="Instructions">Any changes made will not be updated until the Save button is pressed.</span></td>
		<td style="text-align:right; padding-right:50px;"><asp:Button ID="butOK" runat="server" Text="Save..." onclick="butOK_Click" />
	<ajax:ConfirmButtonExtender ID="butOK_ConfirmButtonExtender" runat="server" 
		ConfirmText="Save changes to the list of letter types?" Enabled="True" TargetControlID="butOK">
	</ajax:ConfirmButtonExtender>
	&nbsp;&nbsp;<asp:Button ID="butRevert" runat="server" Text="Revert" onclick="butRevert_Click" /></td>
	</tr>
</table>
</asp:Panel>

<!-- Update progress -->
<asp:UpdateProgress ID="updateProgress1" runat="server" DisplayAfter="500">
<ProgressTemplate>
	<div class="pnlProgressStyle"><h4>Loading data.  Please wait...</h4></div>
</ProgressTemplate>
</asp:UpdateProgress>

</asp:Content>
